<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.7" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">
    <style>
        .el-row {
            margin-bottom: 20px;
        }
        .el-col {
            border-radius: 4px;
        }
        .bg-purple-dark {
            background: #99a9bf;
        }
        .bg-purple {
            background: #d3dce6;
        }
        .bg-purple-light {
            background: #e5e9f2;
        }
        .grid-content {
            border-radius: 4px;
            min-height: 36px;
        }
        .row-bg {
            padding: 10px 0;
            background-color: #f9fafc;
        }
    </style>
</head>
<body class="gray-bg">

<div id="app">
    <el-menu
            :default-active="activeIndex2"
            class="el-menu-demo"
            mode="horizontal"
            @select="handleSelect"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
    >
    </el-menu>
    <template>
        <el-table
                :data="tableData"
                style="width: 100%"
                :row-class-name="tableRowClassName"
                @selection-change="handleSelectionChange">
            <el-table-column
                    type="selection"
                    width="55">
            </el-table-column>
            <el-table-column
                    type="index"
                    width="50">
            </el-table-column>
            <el-table-column
                    prop="file"
                    label="文件名"
                    align="center"
            >
                <!--  <a href="/webxx/wj/up/filename=file">文件下载</a>-->
            </el-table-column >
            <el-table-column
                    align="center"
                    label="操作">
                <template slot-scope="scope">
                    <el-button type="danger"plain @click="kan(scope.$index, scope.row)" >查看</el-button>
                    <el-button type="primary" plain @click="ups(scope.$index, scope.row)">下载</el-button>
                </template>
            </el-table-column>
        </el-table>
    </template>
</div>
<script src="js/vue.js"></script>
<script src="element-ui/lib/index.js"></script>
<link rel="stylesheet" href="element-ui/lib/theme-chalk/index.css">
<script src="js/axios-0.18.0.js"></script>
<!-- 全局js -->
<script src="js/jquery.min.js?v=2.1.4"></script>
<script src="js/bootstrap.min.js?v=3.3.7"></script>
<!-- 自定义js -->
<script src="js/content.js?v=1.0.0"></script>
<!-- fullavatareditor -->
<script type="text/javascript" src="plugins/fullavatareditor/scripts/swfobject.js"></script>
<script type="text/javascript" src="plugins/fullavatareditor/scripts/fullAvatarEditor.js"></script>
<script type="text/javascript" src="plugins/fullavatareditor/scripts/jQuery.Cookie.js"></script>
<script type="text/javascript" src="plugins/fullavatareditor/scripts/test.js"></script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
<!--统计代码，可删除-->
<script>
    // 创建一个新的 Vue 实例
    var app = new Vue({
        el: '#app',
        mounted(){
            //当页面加载完成后，发送异步请求，获取数据

            this.selectAll();

        },
        data() {
            return {dialogVisible:false,
                dialogVisible1:false,
                activeIndex: '1',
                activeIndex2: '1',
                input:'',input1:'',
                selectedIds:[],
                // 复选框选中数据集合
                multipleSelection: [],
                file:'',
                h:'ss',
                tableData: [{
                    file:''
                }, {
                    file:''
                }]
            };
        },
        methods: {
            handleSelectionChange(val) {
                this.multipleSelection = val;

            },
            tableRowClassName({row, rowIndex}) {
                if (rowIndex === 1) {
                    return 'warning-row';
                } else if (rowIndex === 3) {
                    return 'success-row';
                }
                return '';
            },
            selectAll(){
                var _this=this;
                axios({
                    method:"get",
                    url:"http://localhost:8080/wenxian-master/wj/file"

                }).then(function (resp)
                {
                    _this.tableData=resp.data;
                })


            },
            ups(index, row)
            {
                window.open("http://localhost:8080/wenxian-master/wj/up?filename="+row.file);
                /* var _this=this;
                 axios({
                     method:"post",
                     url:"http://localhost:8080/webxx/wj/up",
                     data:row.file

                 })*/
            },kan(index, row)
            {
                window.open("http://localhost:8080/wenxian-master/upload/"+row.file);
            }

        }
    });
</script>
</body>
</html>
